package com.itheima.d04_thread_methods;

public class MyThread extends Thread{

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {

        //方法1：sleep方法，线程暂停
        //使用场景：模拟耗时
        try {
            Thread.sleep(10); //毫秒
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        //耗时5s：模拟下载学习资料
        for (int i = 0; i < 10; i++) {
            System.out.println("\t"+getName()+"：下载学习资料... ...");

        }

    }
}
